IA64: fix fp fault/trap handler.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 12 Dec 2008 01:34:18 +0000 (10:34 +0900)
committerIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 12 Dec 2008 01:34:18 +0000 (10:34 +0900)
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392

When fpswa handler fails to get a bundle in guest,
fp fault/trap should be injected into the guest and let a guest
to handle it.
When the fpswa library return a error, there is no way to
pass the value to the guest. In that case, just inject fpswa
fault/trap into a guest running a risk that guest may get
error with their own fpswa call. Here it is assumed that
no applications depend on SIGFP process signal to recover
their computation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/vmx/vmx_fault.c
xen/arch/ia64/xen/faults.c
xen/include/asm-ia64/domain.h

index 586e6925f2eced2e9fe1e5303552c5b6cf2fa301..53d0693876659a052f61bda5fab6686068947bda 100644 (file)
@@ -122,8 +122,7 @@ void vmx_reflect_interruption(u64 ifa, u64 isr, u64 iim,
         if (!status) {
             vcpu_increment_iip(vcpu);
             return;
-        } else if (IA64_RETRY == status)
-            return;
+        }
         break;
 
     case 33:   // IA64_FP_TRAP_VECTOR
@@ -133,10 +132,6 @@ void vmx_reflect_interruption(u64 ifa, u64 isr, u64 iim,
         status = handle_fpu_swa(0, regs, isr);
         if (!status)
             return;
-        else if (IA64_RETRY == status) {
-            vcpu_decrement_iip(vcpu);
-            return;
-        }
         break;
 
     case 29: // IA64_DEBUG_VECTOR
index a32c3c6dafac69e62f57d449d9d89b56668b72f9..d1327e8681e3387d563a0bf2b80c87cc467422cd 100644 (file)
@@ -314,7 +314,6 @@ fp_emulate(int fp_fault, void *bundle, unsigned long *ipsr,
 unsigned long
 handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr)
 {
-       struct vcpu *v = current;
        IA64_BUNDLE bundle;
        unsigned long fault_ip;
        fpswa_ret_t ret;
@@ -348,7 +347,6 @@ handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr)
                         &isr, &regs->pr, &regs->cr_ifs, regs);
 
        if (ret.status) {
-               PSCBX(v, fpswa_ret) = ret;
                printk("%s(%s): fp_emulate() returned %ld\n",
                       __FUNCTION__, fp_fault ? "fault" : "trap", ret.status);
        }
@@ -688,9 +686,6 @@ ia64_handle_reflection(unsigned long ifa, struct pt_regs *regs,
                        vcpu_increment_iip(v);
                        return;
                }
-               // fetch code fail
-               if (IA64_RETRY == status)
-                       return;
                printk("ia64_handle_reflection: handling FP fault\n");
                vector = IA64_FP_FAULT_VECTOR;
                break;
@@ -698,11 +693,6 @@ ia64_handle_reflection(unsigned long ifa, struct pt_regs *regs,
                status = handle_fpu_swa(0, regs, isr);
                if (!status)
                        return;
-               // fetch code fail
-               if (IA64_RETRY == status) {
-                       vcpu_decrement_iip(v);
-                       return;
-               }
                printk("ia64_handle_reflection: handling FP trap\n");
                vector = IA64_FP_TRAP_VECTOR;
                break;
index 43e4691a7aa078ac6eb86babaec1a052ebe5b7fd..2c9f21f0896d56f93b3e33f7a199a53b9ab41617 100644 (file)
@@ -288,7 +288,6 @@ struct arch_vcpu {
     char irq_new_condition;    // vpsr.i/vtpr change, check for pending VHPI
     char hypercall_continuation;
 
-    fpswa_ret_t fpswa_ret;     /* save return values of FPSWA emulation */
     struct timer hlt_timer;
     struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */